<!DOCTYPE html>
<html>
<#include "include/header.html"/>
  <body id="football">
    <div class="page">
    <div class="menu">
           <a href="${ctx}/home/homePage?is_dialog=1#ban_id" class="anchor"><div class="trigger"></div></a>
          </div>
      <div class="content">
        <img src="${ctx}/resource/images/football/banner.png" class="banner">
<div class="info">
      <#if championUser??>
            <div class="coins">我的活力币：<span id="myEnergyCurrency">${championUser.energy_currency!}</span></div>
            <#else>
            <div class="coins">我的活力币：<span id="myEnergyCurrency">0</span></div>
            </#if>
          </div>  
        <div class="main">
          <!-- A组 (一组一个container) -->
          <#list championCompetitionList as a >
            <div class="container">
            <section class="header">
              <img src="${ctx}/resource/images/football/logo.png" class="logo">
              <div class="ban">
                比赛时间<span>${a.championCompetition.competition_type_name!}</span>${a.championCompetition.begin_time_df!}
              </div>
              <img src="${ctx}/resource/images/football/drinks.png" class="drinks">
            </section>
            <section class="vs">
              <div class="left">
              <div class="border"></div>
                <div class="pic" style="background-image: url('${server_uri!}${a.championCompetition.home_team_pic!}');">
                  <div class="label">${a.championCompetition.home_team_name!}</div>
                </div>
              </div>
              <div class="center">
                <img src="${ctx}/resource/images/football/vs.png">
              </div>
              <div class="right">
              <div class="border"></div>
                <div class="pic" style="background-image: url('${server_uri!}${a.championCompetition.visiting_team_pic!}');">
                  <div class="label">${a.championCompetition.visiting_team_name!}</div>
                </div>
              </div>
            </section>
            <section class="countdown">
            <input type="hidden"  value="${a.championCompetition.guess_second!}" />
            <input type="hidden"  value="${a.championCompetition.is_guess!}"/>  
              <div>
                             竞猜时间：0 天 0 时 0 分 0 秒
              </div>
            </section>
            <section class="bet">
            <!-- 已开奖 -->
            <#if a.championCompetition.winner?? >
            <#if a.championCompetition.winner = "01">
            <#if a.championUserGuessing??>
            <#if a.championUserGuessing.competition_result = '01'>
             <img id="win_${a_index!}"    src="${ctx}/resource/images/football/win_result_select.png" >
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->             <img id="lose_${a_index!}"   src="${ctx}/resource/images/football/lose_disabled.png">
            <#else>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_result.png">
             <#if a.championUserGuessing.competition_result = '02'>
<!--               <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/tie_selected.png" >
 -->             <#else>
<!--              <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/tie_disabled.png" >
 -->             </#if>
             <#if a.championUserGuessing.competition_result = '03'>
              <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_selected.png" >
             <#else>
             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png" >
             </#if>
             </#if>
            <#else>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_result.png">
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            </#if>
            <#if a.championCompetition.winner = "02">
            <#if a.championUserGuessing??>
            <#if a.championUserGuessing.competition_result = '02'>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/draw_result_select.png">
 -->             <img id="lose_${a_index!}"   src="${ctx}/resource/images/football/lose_disabled.png">
             <#else>
             <#if a.championUserGuessing.competition_result = '01'>
              <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_selected.png" >
             <#else>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
             </#if>
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/draw_result.png">
 -->             <#if a.championUserGuessing.competition_result = '03'>
              <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_selected.png" >
             <#else>
             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png" >
             </#if>
            </#if>
            <#else>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--              <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/draw_result.png">
 -->             <img id="lose_${a_index!}"   src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            </#if>
            <#if a.championCompetition.winner = "03">
            <#if a.championUserGuessing??>
            <#if a.championUserGuessing.competition_result = '03'>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_result_select.png" >
            <#else>
            <#if a.championUserGuessing.competition_result = '01'>
              <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_selected.png" >
             <#else>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
             </#if>
             <#if a.championUserGuessing.competition_result = '02'>
<!--               <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/tie_selected.png" >
 -->             <#else>
<!--              <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/tie_disabled.png" >
 -->             </#if>
             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_result.png" >
            </#if>
            
            <#else>
             <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_result.png">
            </#if>
            </#if>
            <#else>
            <!-- 未开奖 -->
            <#if a.championCompetition.competition_status = '01'>
            <#if a.championUserGuessing??>
            <#if a.championUserGuessing.competition_result = '01'>
            <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_selected.png" >
<!--             <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            <#if a.championUserGuessing.competition_result = '02'>
            <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--             <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/tie_selected.png" >
 -->            <img id="lose_${a_index!}"   src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            <#if a.championUserGuessing.competition_result = '03'>
            <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--             <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->            <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_selected.png" >
            </#if>
            <#else>
            <#if a.championCompetition.is_guess = '1'>
             <img id="win_${a_index!}"   src="${ctx}/resource/images/football/win.png" onclick="selectResult('01','${a_index!}');" >
<!--              <img id="tie_${a_index!}"   src="${ctx}/resource/images/football/tie.png" onclick="selectResult('02','${a_index!}');">
 -->              <img id="lose_${a_index!}" src="${ctx}/resource/images/football/lose.png" onclick="selectResult('03','${a_index!}');">
             <#else>
             <img id="win_${a_index!}"    src="${ctx}/resource/images/football/win_disabled.png" >
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->              <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            </#if>
            <#else>
            <#if a.championUserGuessing??>
            <#if a.championUserGuessing.competition_result = '01'>
            <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_selected.png" >
<!--             <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->             <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            <#if a.championUserGuessing.competition_result = '02'>
            <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--             <img id="tie_${a_index!}"  src="${ctx}/resource/images/football/tie_selected.png" >
 -->            <img id="lose_${a_index!}"   src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            <#if a.championUserGuessing.competition_result = '03'>
            <img id="win_${a_index!}"  src="${ctx}/resource/images/football/win_disabled.png" >
<!--             <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->            <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_selected.png" >
            </#if>
            <#else>
            <#if a.championCompetition.is_guess = '1'>
             <img id="win_${a_index!}"   src="${ctx}/resource/images/football/win.png" onclick="selectResult('01','${a_index!}');" >
<!--              <img id="tie_${a_index!}"   src="${ctx}/resource/images/football/tie.png" onclick="selectResult('02','${a_index!}');">
 -->              <img id="lose_${a_index!}" src="${ctx}/resource/images/football/lose.png" onclick="selectResult('03','${a_index!}');">
             <#else>
             <img id="win_${a_index!}"    src="${ctx}/resource/images/football/win_disabled.png" >
<!--              <img id="tie_${a_index!}"    src="${ctx}/resource/images/football/tie_disabled.png">
 -->              <img id="lose_${a_index!}"  src="${ctx}/resource/images/football/lose_disabled.png">
            </#if>
            </#if>
            </#if>
            </#if>
            </section>
              <#if a.championUserGuessing??>
              <div id="result_${a_index!}" style="display:none">${a.championUserGuessing.competition_result!}</div>
              <#else>
              <div id="result_${a_index!}" style="display:none"></div>
              </#if>
            <section>
              <div class="vs-change">
                <div class="supp">
                <#if a.championCompetition.competition_status = '01'>
                <#if a.championCompetition.is_guess = '1'>
                 <#if a.championUserGuessing??>
                  <div class="bar disabled">  <!-- class加上disabled变为不可用 -->
                    <input type="tel"  readonly="readonly" id="payNum_${a_index!}" value="${a.championUserGuessing.pay_currency!}"/>
                  </div>
                  <#else>
                  <div class="bar disabled">  <!-- class加上disabled变为不可用 -->
                    <input type="tel" id="payNum_${a_index!}" placeholder="点击输入"/>
                  </div>
                  </#if>
                  <#else>
                  <#if a.championUserGuessing??>
                  <div class="bar disabled">  <!-- class加上disabled变为不可用 -->
                    <input type="tel"  readonly="readonly" id="payNum_${a_index!}" value="${a.championUserGuessing.pay_currency!}"/>
                  </div>
                  <#else>
                  <div class="bar disabled">  <!-- class加上disabled变为不可用 -->
                    <input type="tel" id="payNum_${a_index!}" readonly="readonly" placeholder=""/>
                  </div>
                  </#if>
                  </#if>
                  <#else>
                  <#if a.championUserGuessing??>
                  <div class="bar disabled">  <!-- class加上disabled变为不可用 -->
                    <input type="tel"  readonly="readonly" id="payNum_${a_index!}" value="${a.championUserGuessing.pay_currency!}"/>
                  </div>
                  <#else>
                  <div class="bar disabled">  <!-- class加上disabled变为不可用 -->
                    <input type="tel" id="payNum_${a_index!}" readonly="readonly" />
                  </div>
                  </#if>
                  </#if>
                  <#if a.championUserGuessing??>
                  <div class="btn" id="submit_${a_index!}" ><img id="vs_${a_index!}" src="${ctx}/resource/images/index/vs_btn_gray.png"></div>
               <#else>
               <#if a.championCompetition.competition_status = '01'>
                <#if a.championCompetition.is_guess = '1'>
                  <div class="btn" id="submit_${a_index!}" onclick="guessEuropeCompetition('${a.championCompetition.id!}','${a_index!}');"><img id="vs_${a_index!}" src="${ctx}/resource/images/index/vs_btn.png"></div>
               <#else>
                 <div class="btn" id="submit_${a_index!}" ><img id="vs_${a_index!}" src="${ctx}/resource/images/index/vs_btn_gray.png"></div>
               </#if>
               <#else>
                 <div class="btn" id="submit_${a_index!}" ><img id="vs_${a_index!}" src="${ctx}/resource/images/index/vs_btn_gray.png"></div>
               </#if>
               </#if>
                </div>
                <#if a.championCompetition.is_guess = '1'>
                <#if a.championCompetition.winner?? >
                <#if a.championUserGuessing??>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span>${a.expect_energy_currency!}</span></div>  <!-- class加上disabled变为不可用 -->
                <#else>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span>0</span></div>  <!-- class加上disabled变为不可用 -->
                </#if>
                <#else>
                <#if a.championUserGuessing??>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span>${a.expect_energy_currency!}</span></div>  <!-- class加上disabled变为不可用 -->
                <#else>
                <div class="result-bar" id="expectCurrency_${a_index!}"><span></span></div>  <!-- class加上disabled变为不可用 -->
                </#if>
                </#if>
                <#else>
                <#if a.championCompetition.winner?? >
                <#if a.championUserGuessing??>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span>${a.expect_energy_currency!}</span></div>  <!-- class加上disabled变为不可用 -->
                <#else>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span>0</span></div>  <!-- class加上disabled变为不可用 -->
                </#if>
                <#else>
                <#if a.championUserGuessing??>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span>${a.expect_energy_currency!}</span></div>  <!-- class加上disabled变为不可用 -->
                <#else>
                <div class="result-bar disabled" id="expectCurrency_${a_index!}"><span></span></div>  <!-- class加上disabled变为不可用 -->
                </#if>
                </#if>
                </#if>
              </div>
            </section>
          </div>
          </#list>
          

        </div>
      </div>
      <!-- 提交成功 -->
	  <div class="dialog sub-success">
		<div class="d-body"></div>
			<div class="d-footer">
				<img src="${ctx}/resource/images/index/dialog_btn_back.png" class="btn one back" alt="" onclick="dialogClose()">
																										<!--返回按钮-->
			</div>
	  </div>
	  <div class="dialog qd-success">
        <div class="d-body" id="qd-success-sign">
          <p>获得<span>100</span>个活力币</p>
        </div>
        <div class="d-footer">
          <img src="${ctx}/resource/images/index/dialog_btn_back.png" class="btn one back" alt="" onclick="dialogClose()"> <!--返回按钮-->
        </div>
      </div>
      <!-- 兑换失败 -->
      <div class="dialog exchange-fail">
        <div class="d-body" id="exchange-fail-currency">
        <p class="message">系统繁忙 请稍后再试</p>
        </div>
        <div class="d-footer">
          <img src="${ctx}/resource/images/index/dialog_btn_back.png" class="btn one back" alt="" onclick="dialogClose()"> <!--返回按钮-->
        </div>
      </div>
    </div>
    <div class="mask">
      <div class="share">
        <img src="${ctx}/resource/images/wx/share_tip.png" class="tip">
        <img src="${ctx}/resource/images/wx/share_dialog.png" class="dialog_">
        <div class="d-footer">
        <img src="${ctx}/resource/images/wx/dialog_index.png" class="btn one back" onclick="forwardIndex();">
      </div>
      </div>
      
    </div>
    <script type="text/javascript">
      $(".container").not(":first-child").find(".drinks").remove();
$(".pill").on("click", function() {
  $(this).siblings(".pill").removeClass("active").end().addClass("active")
})


	  var team_odds = "2";
	//选择比赛结果
	function selectResult(option,index) {
	    statistics(); //cnzz统计
	    $("#result_"+index+"").html(option);
	    if(option == "01"){
	    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win_selected.png");
	    $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie.png");
	    $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose.png");
	    }
	     if(option == "02"){
	    $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie_selected.png");
	    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win.png");
	    $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose.png");
	    }
	     if(option == "03"){
	    $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose_selected.png");
	    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win.png");
	    $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie.png");
	    }
	}
	function share() {
  $(".mask, .share").show();
  $(".mask").on("click", function() {
    $(".mask, .share").hide()
  })
}
		function forwardIndex(){
		    window.location.href="${ctx}/home/homePage?is_dialog=1#ban_id";
		}
      function guessEuropeCompetition(id,index){
      statistics(); //cnzz统计
      $("#submit_"+index+"").attr("disabled","disabled");
      var competition_result=$("#result_"+index+"").html();
      if(!competition_result ){
			var warningHtm = "<p class='message'>请选择一个结果进行竞猜</p>";
			$("#exchange-fail-currency").html(warningHtm);
			dialog(".exchange-fail");
			return;
		}
		var currency_num = $("#payNum_"+index+"").val();
		if (!currency_num) {
			var warningHtm = "<p class='message'>活力币不能为空</p>";
			$("#exchange-fail-currency").html(warningHtm);
			dialog(".exchange-fail");
			return;
		}
		if (currency_num < 0) {
			var warningHtm = "<p class='message'>活力币不能为负</p>";
			$("#exchange-fail-currency").html(warningHtm);
			dialog(".exchange-fail");
			return;
		}
		$.ajax({type : "POST",url : "${ctx}/home/guessEuropeCompetition",async : false,data:{
	"content":"#来吧冠军##欧洲杯这样看#我在“小样足球大狂欢”中竞猜#法国欧洲杯#――competition的比赛结果为result，小伙伴们也一起来竞猜赢iphone6s等豪礼，为欧洲杯加油吧！http://lbgj.fansiji.com/xyChampion/home/forwardEuropeGuessing?source=europe",
	"pic":"/alidata/server/tomcat-7.0.54/webapps/xyChampion/resource/images/index/europe.png",
	"competition_id":id,
	"pay_currency":currency_num,
	"pay_odds":team_odds,
	"competition_result":competition_result
	},success:function(json){
	       if(json.code == 0 ){
	            $("#payNum_"+index+"").attr("readonly","readonly");
			    $("#expectCurrency_"+index+"").html("<span>"+json.callBackData.get_energy_currency+"</span>");
			    $("#expectCurrency_"+index+"").addClass("disabled");
			    //$("#myEnergyCurrency").html(data.callBackData.remain_energy_currency);
			    $("#submit_"+index+"").addClass("disabled");
			    $("#vs_"+index+"").attr("src","${ctx}/resource/images/index/vs_btn_gray.png");
			    if(competition_result == "01"){
	             $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie_disabled.png");
	             $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose_disabled.png");
	            }
			     if(competition_result == "02"){
			    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win_disabled.png");
			    $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose_disabled.png");
			    }
			     if(competition_result == "03"){
			    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win_disabled.png");
			    $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie_disabled.png");
			    }
			    $("#win_"+index+"").removeAttr("onclick");
			    $("#tie_"+index+"").removeAttr("onclick");
			    $("#lose_"+index+"").removeAttr("onclick");
			    $("#submit_"+index+"").removeAttr("onclick");
			    $("#myEnergyCurrency").html(json.callBackData.remain_energy_currency);
				//dialog(".sub-success");
				share();
	       }else{
	       if(json.code == 404 ){
	            window.location.href=json.msg;
	       }else{
	           var msg="<p class='message'>"+json.msg+"</p>";
		       $("#exchange-fail-currency").html(msg);
	           dialog(".exchange-fail");
	           }
	           $("#submit_"+index+"").removeAttr("disabled");
	           }
	       }
	    }); 
      }
      //倒计时	  
		function timer()
		{
			$(".countdown").each(function(index){
				var ts = parseInt($($(this).find("input")[0]).val());//计算剩余的毫秒数
				var guess=parseInt($($(this).find("input")[1]).val());
				var competitionResult=$("#result_"+index+"").html();
				if(guess == 1 ){
				if(ts>=1){
					ts--;
					$($(this).find("input")[0]).val(ts);
					var dd = parseInt(ts  / 60 / 60 / 24, 10);//计算剩余的天数
					var hh = parseInt(ts  / 60 / 60 % 24, 10);//计算剩余的小时数
					var mm = parseInt(ts  / 60 % 60, 10);//计算剩余的分钟数
					var ss = parseInt(ts  % 60, 10);//计算剩余的秒数
					//dd = checkTime(dd);
					hh = checkTime(hh);
					mm = checkTime(mm);
					ss = checkTime(ss);
					$(this).find("div").html("竞猜时间："+ dd +" 天 "+ hh +" 时 "+ mm +" 分 "+ ss +" 秒")
					//document.getElementById("timer").innerHTML = dd + "天" + hh + "时" + mm + "分" + ss + "秒";
				}
				else{
				    $(this).find("div").html("竞猜时间：0 天 0 时 0 分 0 秒")
				    $("#expectCurrency_"+index+"").addClass("disabled");
					$("#payNum_"+index+"").attr("readonly","readonly");
				    $("#submit_"+index+"").addClass("disabled");
				    $("#vs_"+index+"").attr("src","${ctx}/resource/images/index/vs_btn_gray.png");
				    if(!competitionResult){
				    $("#payNum_"+index+"").attr("placeholder","");
				    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win_disabled.png");
				    $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie_disabled.png");
		            $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose_disabled.png");
				    }else{
				    if(competitionResult == "01"){
		             $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie_disabled.png");
		             $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose_disabled.png");
		            }
				     if(competitionResult == "02"){
				    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win_disabled.png");
				    $("#lose_"+index+"").attr("src","${ctx}/resource/images/football/lose_disabled.png");
				    }
				     if(competitionResult == "03"){
				    $("#win_"+index+"").attr("src","${ctx}/resource/images/football/win_disabled.png");
				    $("#tie_"+index+"").attr("src","${ctx}/resource/images/football/tie_disabled.png");
				    }
				    }
				    $("#win_"+index+"").removeAttr("onclick");
				    $("#tie_"+index+"").removeAttr("onclick");
				    $("#lose_"+index+"").removeAttr("onclick");
				    $("#submit_"+index+"").removeAttr("onclick");
				    $($(this).find("input")[1]).val("0");
				}
				}
			});
		}
		//时间补位
		function checkTime(i)  
		{  
			if (i < 10) {  
				i = "0" + i;  
			}  
			return i;  
		}  
					
		timer();
		setInterval(function () {
			timer();
		}, 1000);
    </script>
  </body>
</html>